package com.cowin.inf.dao;

import com.cowin.base.Mapper;
import com.cowin.inf.model.KyDeviceProperty;
import com.cowin.inf.model.KyDeviceState;
import com.cowin.inf.model.vo.KyDeviceStateVo;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface KyDeviceStateMapper extends Mapper<KyDeviceState> {
    /**
     * 功能描述:更新心跳时间 <br>
     *  <>
     * @Param:[deviceId]
     * @Return:int
     * @Author:yuchao
     * @Date: 2020/4/24 20:55
     */
    @Update("UPDATE KY_DEVICE_STATE SET HEARTBEAT_TIME=sysdate where DEVICE_ID=#{0}")
    int updateHeartbeatTime(Integer deviceId);

    @Update("UPDATE KY_DEVICE_STATE SET FAULT_CODE=#{faultCode}, SET NODE_TIME=#{nodeTime}, SET BREAK_REASON=#{breakReason},SET HEARTBEAT_TIME=sysdate where DEVICE_ID=#{deviceId}")
    int updateDeviceState(KyDeviceState kyDeviceState);

    List<KyDeviceStateVo> pmcMonitor(String workShopNo);

}